import { openFloatPane, registerAppMenu } from '@/app'
import { nextKey } from '@/widgets'
import { default as ColorExample } from './ColorExample.vue'
import { default as ButtonExample } from './ButtonExample.vue'
import { default as LabelExample } from './LabelExample.vue'
import { default as ModalExample } from './ModalExample.vue'
import { default as NotifyExample } from './NotifyExample.vue'
import { default as TabsExample } from './TabsExample.vue'
import { default as TooltipExample } from './TooltipExample.vue'
import { default as BadgeExample } from './BadgeExample.vue'
import { default as ContextMenuExample } from './ContextMenuExample.vue'
import { default as InputExample } from './InputExample.vue'

export async function setup() {
  registerAppMenu({
    path: '样例/系统配色 | Color',
    onClick() {
      openFloatPane({
        name: '系统配色-样例',
        icon: 'mas-icon-model',
        key: nextKey(),
        component: ColorExample
      })
    }
  })
  registerAppMenu({
    path: '样例/按钮 | Button',
    onClick() {
      openFloatPane({
        name: '按钮-样例',
        key: nextKey(),
        component: ButtonExample
      })
    }
  })
  registerAppMenu({
    path: '样例/文本框 | Label',
    onClick() {
      openFloatPane({
        name: '文本框-样例',
        key: nextKey(),
        component: LabelExample
      })
    }
  })
  registerAppMenu({
    path: '样例/模态框 | Modal',
    onClick() {
      openFloatPane({
        name: '模态框-样例',
        key: nextKey(),
        component: ModalExample
      })
    }
  })
  registerAppMenu({
    path: '样例/通知 | Notify',
    onClick() {
      openFloatPane({
        name: '通知-样例',
        key: nextKey(),
        component: NotifyExample
      })
    }
  })

  registerAppMenu({
    path: '样例/标签页 | Tabs',
    onClick() {
      openFloatPane({
        name: '标签页-样例',
        key: nextKey(),
        component: TabsExample
      })
    }
  })
  registerAppMenu({
    path: '样例/提示框 | Tooltip',
    onClick() {
      openFloatPane({
        name: '提示框-样例',
        key: nextKey(),
        component: TooltipExample
      })
    }
  })
  registerAppMenu({
    path: '样例/徽标 | Badge',
    onClick() {
      openFloatPane({
        name: '徽标-样例',
        key: nextKey(),
        component: BadgeExample
      })
    }
  })
  registerAppMenu({
    path: '样例/快捷菜单 | ContextMenu',
    onClick() {
      openFloatPane({
        name: '快捷菜单-样例',
        key: nextKey(),
        component: ContextMenuExample
      })
    }
  })
  registerAppMenu({
    path: '样例/输入框 | Input',
    onClick() {
      openFloatPane({
        name: '输入框-样例',
        key: nextKey(),
        component: InputExample
      })
    }
  })
}
